<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<link rel="stylesheet" href="${aier_css_url}social/module/reset.css" />
<table style="width: 90%;height: 90%;">
	<tr>
		<td width=80%>
			<div class="d_scnOut" style="margin-top: 10px; margin-left: -76px;">
                <div class="d_scname">
                    <label>账号:</label>
                </div>
                <div class="d_sctext" >
                    <input type="text" id="account" class="PY-input">
                </div>
            </div>
            <button onclick="checkAccount();"
                class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
                role="button" aria-disabled="false" style="margin-top: -80px;margin-left:220px;">
                <span class="ui-button-text">查找</span>
            </button>
			
			<p id="msg"></p>
			<p id="msg1"></p>
			<br />
			<br />
		</td>
	</tr>
</table>

	<script type="text/javascript">

	    var s_pid;
	    function changeColor(pid){
	    	document.getElementById(pid).style.backgroundColor = 'red';
	    	s_pid=pid; 
	   };

		//判断用户名是否存在，读取用户的电话，邮箱等信息 
        function checkAccount(){
	       var fun=function(data){
	           if(data.s==2){
		           var e="<span>";
		           
				   e+="<input type='hidden' id='uid' value='"+data.uid+"'>";
				  
		           $("#msg").html(e);
		           var c = "<span id="+data.proxy.pid+">"+data.proxy.name+"</span><input type='button' value='选择' onclick='changeColor("+data.proxy.pid+")'/><br/>";
                               $("#msg1").html(c);
                               
	           }else if(data.s==0){
	               alert("用户不存在");
	           }else {
	               alert("用户不是代理商");
	           }
	       };
           exeAjax(
		        ajaxUrl("${aier_url}zxadminjs/adminproxy_searchProxyByUid${aier_suffix}"),
		        fun,{
		           "account":$("#account").val(),
		   });
        }
					    
	</script>